import request from '@/utils/request'

// 查询异常填报列表
export function listRecord(query) {
  return request({
    url: '/mes/exception/handle/list',
    method: 'get',
    params: query
  })
}

// 查询异常填报详细
export function getRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'get'
  })
}

// 新增异常填报
export function addRecord(data) {
  return request({
    url: '/mes/exception/record/add',
    method: 'post',
    data: data
  })
}

// 修改异常填报
export function updateRecord(data) {
  return request({
    url: '/mes/exception/record/edit',
    method: 'post',
    data: data
  })
}

// 删除异常填报
export function delRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'delete'
  })
}

// 异常分类
export function getTreeList(query) {
  return request({
    url: '/mes/type/getTreeList',
    method: 'get',
    params: query
  })
}

// 异常分类
export function getWorkorderBySnCode(data) {
  return request({
    url: '/mes/pro/workorder/getWorkorderBySnCode',
    method: 'post',
    data: data
  })
}

//提交处理方案接口
export function handleSubmit(data) {
  return request({
    url: '/mes/exception/handle/handleSubmit',
    method: 'post',
    data: data
  })
}
// 查询处理方案
export function getProgrammeInfo(query) {
  return request({
    url: '/mes/exception/handle/getProgrammeInfo',
    method: 'get',
    params: query
  })
}

//编辑整改方案信息接口
export function editProgrammeInfo(data) {
  return request({
    url: '/mes/exception/handle/editProgrammeInfo',
    method: 'post',
    data: data
  })
}

//add begin by zyj 2024/11/05 获取异常处理信息列表
export function getHandleList(data){
  return request({
    url: '/mes/exception/follow/getHandleList',
    method: 'get',
    params: data
  })
}

export function getHandleListAll(data){
  return request({
    url: '/mes/exception/follow/getHandleListAll',
    method: 'get',
    params: data
  })
}

export function handleException(data){
  return request({
    url: '/mes/exception/follow/handleException',
    method: 'post',
    data: data
  })
}

//add end by zyj 2024/11/05 获取异常处理信息列表